import request from '@/utils/request'

export const addType = {
  schoolName: undefined,
  quality: undefined,
  institutionPhone: undefined,
  address: undefined,
  isRecommend: undefined,
  status: undefined,
  label: undefined,
  briefIntroduction: undefined,
  firstImage: undefined,
  icon: undefined,
  schoolImage: undefined
}

// 查询高校列表
export function listSchool(query) {
  return request({
    url: '/fetv/school/list',
    method: 'get',
    params: query
  })
}

// 查询高校详细
export function getSchool(id) {
  return request({
    url: '/fetv/school/' + id,
    method: 'get'
  })
}

// 新增高校
export function addSchool(data) {
  return request({
    url: '/fetv/school',
    method: 'post',
    data: data
  })
}

// 修改高校
export function updateSchool(data) {
  return request({
    url: '/fetv/school',
    method: 'put',
    data: data
  })
}

// 删除高校
export function delSchool(id) {
  return request({
    url: '/fetv/school/' + id,
    method: 'delete'
  })
}

// 获得标签
export function getSchoolLabel(query) {
  return request({
    url: '/fetv/school/label/',
    params: {
      query: query
    },
    method: 'get'
  })
}

//获得名字
export function getSchoolNameById(id) {
  return request({
    url: '/fetv/school/name/' + id,
    method: "get"
  })
}
